home *** CD-ROM | disk | FTP | other *** search
- Path: reuna.cl!utfsm!vonbrand
- From: vonbrand@pincoya.inf.utfsm.cl (Horst von Brand)
- Newsgroups: comp.lang.c++
- Subject: Re: Simplistic cin Question
- Date: 4 Jan 1996 16:50:14 -0300
- Organization: Departamento de Informatica, Universidad Tecnica Federico Santa Maria
- Message-ID: <4chb1m$16k@pincoya.inf.utfsm.cl>
- References: <4bedim$ol3@sage.cc.purdue.edu>
- NNTP-Posting-Host: pincoya.inf.utfsm.cl
-
- In article <4bedim$ol3@sage.cc.purdue.edu>,
- Steve Mancini <mancinis@sage.cc.purdue.edu> wrote:
- >[How to read in something like:]
-
- > 14 142616 N 37flr_reducer_clib.prt.1 33-16 T2
- > 65 150911 U 37flr_sto_con_clib.prt.7 33-01 T2
- > 62 409213 U 37flr_sto_elbow_clib.prt.22 33-06 T2&6
- > 2 144998 U 7t1099_weldlink_clib.prt.8 None
- > 96 217743 U bolt_12pthd_i_a516.prt.18 23-78
-
- >[Problem at the third line, reading 2 int, char, 2 char[] ]
-
- Easy: The first 3 lines have 6 fields, the others 5 :-). Make sure you
- read the line into a buffer and parse it from there, that way leftover
- garbage can't affect you; and you have a easier time handling short lines.
- --
- Dr. Horst H. von Brand vonbrand@inf.utfsm.cl
- Departamento de Informatica Fono: +56 32 626364 x 431
- Universidad Tecnica Federico Santa Maria Fax: +56 32 625217
- Casilla 110-V, Valparaiso, Chile
-